package com.syh.jn.scm.dto.upstream.finance;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotEmpty;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 上游对账单新增
 */
@Data
public class UpStatementAccountBillSto implements Serializable {
  /**
   * 录单人id
   */
  @NotNull(message = "录单人id不能为空")
  private Long brokerageId;
  /**
   * 对账金额
   */
  private BigDecimal price;
  /**
   * 归属id
   */
  @NotNull(message = "归属id不能为空")
  private Long businessEntityId;
  /**
   * 客户id
   */
  private Long customerId;
  /**
   * 对账单项
   */
  private List<UpStatementAccountBillItemSto> items;

  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  public class UpStatementAccountBillItemSto implements Serializable {
    /**
     * 来源单类型  2销售单 3 销售退货单 4 收入单 5 费用单
     */
    @NotNull(message = "来源单类型不能为空")
    private Short sourceType;
    /**
     * 来源单号
     */
    @NotEmpty(message = "来源单号不能为空")
    private String sourceCode;
    /**
     * 来源单id
     */
    @NotNull(message = "来源单id不能为空")
    private Long sourceId;

  }
}
